package org.onepiece.admin.common.config.yaml;

import com.alibaba.fastjson2.JSON;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Component;

import java.util.Map;

/**
 * Created by IntelliJ IDEA.
 *
 * @author zhujianke@gaodun.com
 * @since 2022/10/28 11:57
 */
@AllArgsConstructor
@Component
public class AllocationRuleScorePropertiesComponent {

    private final AllocationRuleScoreProperties allocationRuleScoreProperties;

    @SuppressWarnings("unchecked")
    public Map<String, Integer> getMap() {
        return JSON.parseObject(allocationRuleScoreProperties.toString(), Map.class);
    }
}
